home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Border.cpp
-
- Contains: Implementation of active border display routines
-
- Owned by: Joshua Susser
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <4> 6/20/95 JBS 1257315 change Facet::AcquireWindow to
- GetWindow
- <3> 5/26/95 RR #1251403: Multithreading naming support
- <2> 5/17/95 JBS 1242496 remove SOM_CATCH
- <1> 2/28/95 JBS first checked in
- <0> 2/28/95 JBS 1198509 created
- */
-
- /*
- These functions are private utilities for use by ODFacet to display and
- invalidate the active border. The functions are platform-dependent, in
- that they make direct calls to the platform graphics system.
- */
-
- #ifndef _BORDER_
- #include "Border.h"
- #endif
-
- #ifndef SOM_ODFacet_xh
- #include <Facet.xh>
- #endif
-
- #ifndef SOM_ODCanvas_xh
- #include <Canvas.xh>
- #endif
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- #ifndef SOM_ODWindow_xh
- #include <Window.xh>
- #endif
-
- #ifndef __QUICKDRAW__
- #include <QuickDraw.h>
- #endif
-
- #pragma segment ODFacet
-
- //==============================================================================
- // Global variables
- //==============================================================================
-
- extern Pattern borderPattern;
-
- //==============================================================================
- // Functions
- //==============================================================================
-
- //------------------------------------------------------------------------------
- // ODDrawBorder
- //------------------------------------------------------------------------------
-
- void
- ODDrawBorder(Environment *ev, ODShape* borderShape, ODFacet* facet)
- {
- GrafPtr savePort;
-
- ODWindow* window = facet->GetWindow(ev);
- if ( window != kODNULL )
- {
- GetPort(&savePort);
-
- SetPort((GrafPtr)(window->GetRootFacet(ev)->
- GetCanvas(ev)->GetPlatformCanvas(ev, kODQuickDraw)));
- SetOrigin(0,0);
- ClipRect(&(ODQDGlobals.thePort->portRect));
-
- RgnHandle borderRgn = borderShape->GetQDRegion(ev);
- FillRgn(borderRgn, &borderPattern);
-
- SetPort(savePort);
- }
- }
-
- //------------------------------------------------------------------------------
- // ODInvalidateBorder
- //------------------------------------------------------------------------------
-
- void
- ODInvalidateBorder(Environment *ev, ODShape* borderShape, ODFacet* facet)
- {
- GrafPtr savePort;
-
- ODWindow* window = facet->GetWindow(ev);
- if ( window != kODNULL )
- {
- GetPort(&savePort);
-
- SetPort((GrafPtr)(window->GetRootFacet(ev)->
- GetCanvas(ev)->GetPlatformCanvas(ev, kODQuickDraw)));
- SetOrigin(0,0);
- ClipRect(&(ODQDGlobals.thePort->portRect));
-
- RgnHandle borderRgn = borderShape->GetQDRegion(ev);
- InvalRgn(borderRgn);
-
- SetPort(savePort);
- }
- }
-
-